import { ApiProperty } from '@nestjs/swagger';
import { IsNotEmpty, IsNumber, IsString, Length } from 'class-validator';

/** 登录dto */
export class LoginDto {
  @IsString()
  @IsNotEmpty({ message: '用户名不能为空' })
  @ApiProperty({ description: '用户名' })
  username: string;

  @IsString()
  @IsNotEmpty({ message: '密码不能为空' })
  @ApiProperty({ description: '密码' })
  password: string;

  @IsString()
  @IsNotEmpty({ message: '验证码不能为空' })
  @ApiProperty({ description: '验证码' })
  captcha: string;

  @IsNumber()
  @IsNotEmpty({ message: 'key 不能为空' })
  @ApiProperty({ description: 'redis captcha 自增key' })
  captchaId: number;
}
